package com.belizer.demo.thread;

public class Demo5 {

    public static void main(String[] args) {
        LoggingWidget loggingWidget = new LoggingWidget();

        loggingWidget.doSomething();
    }

    public static class Widget {
        public synchronized void doSomething() {
            System.out.println("super" + ": calling doSomething");
        }
    }

    public static class LoggingWidget extends Widget {
        public synchronized void doSomething() {
            System.out.println(toString() + ": calling doSomething");
            super.doSomething();
        }
    }
}
